package com.stylefeng.guns.modular.pay.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.google.common.base.Strings;
import com.stylefeng.guns.modular.pay.dao.WithdrawtAccountMapper;
import com.stylefeng.guns.modular.pay.model.WithdrawtAccount;
import com.stylefeng.guns.modular.pay.service.IWithdrawtAccountService;

/**
 * <p>
 * 体现帐号 服务实现类
 * </p>
 *
 * @author stylefeng
 * @since 2018-09-11
 */
@Service
public class WithdrawtAccountServiceImpl extends ServiceImpl<WithdrawtAccountMapper, WithdrawtAccount> implements IWithdrawtAccountService {
	@Autowired
	private WithdrawtAccountMapper withdrawtAccountMapper;
	@Override
	public List<WithdrawtAccount> selectList(WithdrawtAccount account) {
		EntityWrapper<WithdrawtAccount> wrapper = new EntityWrapper<>();
		if(!Strings.isNullOrEmpty(account.getAccountName())){
			wrapper.eq("account_name", account.getAccountName());
		}
		if(!Strings.isNullOrEmpty(account.getAccountNo())){
			wrapper.and().eq("account_no", account.getAccountNo());
		}
		if(!Strings.isNullOrEmpty(account.getAccountType())){
			wrapper.and().eq("account_type", account.getAccountType());
		}
		if(!Strings.isNullOrEmpty(account.getAccountProp())){
			wrapper.and().eq("account_prop", account.getAccountProp());
		}
		wrapper.orderBy("id", false);
		return withdrawtAccountMapper.selectList(wrapper);
	}

}
